From: Giovanni Campagna Date: Fri, 3 Aug 2012 22:14:34 +0000 (+0200) Subject: ScreenShield: constrain vertical movement of the screen lock X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6181 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b53d18fe1cbf113b02e5b4f84b08102e83c31252;p=gnome-shell.git ScreenShield: constrain vertical movement of the screen lock Don't allow dragging the screen lock above and below the screen, as in particular dragging below breaks the illusion of the curtain. https://bugzilla.gnome.org/show_bug.cgi?id=681143 --- diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 11cc86adf..31355a6f7 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -310,7 +310,11 @@ const ScreenShield = new Lang.Class({ this._arrow.connect('repaint', Lang.bind(this, this._drawArrow)); this._lockScreenContents.add_actor(this._arrow); - let action = new Clutter.DragAction({ drag_axis: Clutter.DragAxis.Y_AXIS }); + let dragArea = new Clutter.Rect({ origin: new Clutter.Point({ x: 0, y: -global.screen_height, }), + size: new Clutter.Size({ width: global.screen_width, + height: global.screen_height }) }); + let action = new Clutter.DragAction({ drag_axis: Clutter.DragAxis.Y_AXIS, + drag_area: dragArea }); action.connect('drag-begin', Lang.bind(this, this._onDragBegin)); action.connect('drag-end', Lang.bind(this, this._onDragEnd)); this._lockScreenGroup.add_action(action);